protected Random Random;
protected bool AddingAngle;
- public StandardShip(Game newGame) : base(newGame) {}
+ public StandardShip(SuperPolarity newGame) : base(newGame) {}
public override void Initialize(Texture2D texture, Vector2 position)
{
RotationFactor = (float) (3 * Math.PI / 180);
Random = new Random(BitConverter.ToInt32(cryptoResult, 0));
AddingAngle = true;
+
+ HP = 5;
}
public override void Magnetize(Ship ship, float distance, float angle)
}
ChangeAngle();
Position += Velocity;
+ UpdateBox();
Magnetizing = false;
}
Velocity.Y = -Velocity.Y;
}
}
+
+ public override void Collide(Actor other, Rectangle collision)
+ {
+ if (Dying)
+ {
+ return;
+ }
+
+ if (other.GetType() == typeof(MainShip))
+ {
+ Die();
+ return;
+ }
+
+ if (other.GetType() == typeof(Bullet))
+ {
+ var theBullet = (Bullet)other;
+ TakeDamage(theBullet.Power);
+ }
+ }
+
+ protected override void Die()
+ {
+ ActorManager.CheckOut(this);
+ Renderer.CheckOut(this);
+ game.Player.AddScore(Value);
+ game.Player.AddMultiplier(1);
+ }
}
}